import { getAirHtml } from "@/services/weather";
import { defineStore } from "pinia";

const useAirStore = defineStore("air", {
  state: () => ({
    air: {},
    airText: {},
    day7: [],
  }),
  actions: {
    async fetchAirData(city, code) {
      const res = await getAirHtml(city, code);
      this.air = res.air;
      this.airText = res.airText;
      this.day7 = res.day7;
    },
  },
});

export default useAirStore;
